package org.jeecg.chase.modules.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.chase.modules.entity.AdhCouponInfo;
import org.jeecg.chase.modules.mapper.AdhCouponInfoMapper;
import org.jeecg.chase.modules.service.IAdhCouponInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Map;

/**
 * @author leikai
 * @version 1.0
 * @description:
 * @date 2022/01/08/0008 15:33
 */
@Service
@Transactional
public class AdhCouponInfoServiceImpl extends ServiceImpl<AdhCouponInfoMapper, AdhCouponInfo> implements IAdhCouponInfoService {

    @Autowired
    private AdhCouponInfoMapper adhCouponInfoMapper;


    @Override
    public boolean updateStatus(String id, Integer status) {
        try {
            this.adhCouponInfoMapper.updateStatus(id, status);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    /**
     * @param merchId
     * @param openId
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author leikai
     * @date 2022/03/07/0007 21:40
     */
    @Override
    public List<Map<String, Object>> queryCouponList(String merchId, String openId) {
        return this.adhCouponInfoMapper.queryCouponList(merchId, openId);
    }

}
